export type UserRole = "student" | "teacher" | "admin";

export interface User {
  id: string;
  name: string;
  role: UserRole;
  avatar?: string;
}

export interface DiscussionReply {
  id: string;
  content: string;
  author: User;
  createTime: string;
  likes: number;
  isPinned?: boolean;
}

export interface AIResponse {
  content: string;
  createTime: string;
  status?: "completed" | "processing" | "failed";
}

export type AIRequestStatus = "pending" | "completed" | "failed";

export interface DiscussionPost {
  id: string;
  title: string;
  content: string;
  author: User;
  createTime: string;
  tags: string[];
  views: number;
  likes: number;
  replies: DiscussionReply[];
  isPinned?: boolean;
  aiResponse?: AIResponse;
  aiRequestStatus?: AIRequestStatus;
}

export interface DiscussionFilter {
  keyword?: string;
  tags?: string[];
  sortBy?: "latest" | "popular" | "mostReplies";
  timeRange?: [string, string];
}

export interface DiscussionStats {
  total: number;
  today: number;
  pending: number;
  aiReplyRate: number;
}
